import './App.css';
import User from "./Index/User"
import Header from './Index/Header'
import { Switch,Route,Link } from 'react-router-dom'
import {inject, observer} from 'mobx-react';


function App(props) {
  console.log(props);
  return (
    <div className="App">
      <h1>{props.userInfo.user.name}</h1>
      <Link to="/user">User | </Link>
      <Link to="/header">Header</Link>
      <Switch>
        <Route path="/user" component={User}/>
        <Route path="/header" component={Header}/>
      </Switch>
      {/* <User></User> */}
      {/* <Header></Header> */}
     </div>
  );
}
// 函数组件的注入状态 和声明一个组件为观察状态的组件；

export default inject('userInfo')(observer(App));
